#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
抖音评论爬虫软件启动脚本
"""

import sys
import os

def main():
    try:
        # 添加src目录到Python路径
        current_dir = os.path.dirname(os.path.abspath(__file__))
        src_dir = os.path.join(current_dir, 'src')
        sys.path.insert(0, src_dir)
        
        # 导入并运行增强版主程序
        from enhanced_gui import main as gui_main
        gui_main()
    except ImportError as e:
        print(f"导入模块失败: {e}")
        print("请确保已安装所有依赖项:")
        print("pip install -r requirements.txt")
    except Exception as e:
        print(f"程序运行出错: {e}")
        import traceback
        traceback.print_exc()

if __name__ == "__main__":
    main()